﻿namespace MyBet.Web
{
    using System;
    using System.Collections.Generic;
    using System.ComponentModel.DataAnnotations;
    using System.ServiceModel.DomainServices.Hosting;
    using System.ServiceModel.DomainServices.Server;
    using System.Web.Profile;
    using System.Web.Security;
    using MyBet.Web.Resources;
    using System.ComponentModel;
    using System.Xml.Serialization;
    using System.Runtime.Serialization;

    [DataContractAttribute(IsReference = true)]
    [Serializable()]
    public class CommentObject
    {
        private global::System.Int32 _commentId;
        private global::System.DateTime _commentDate;
        private global::System.Int32 _height;
        private global::System.String _commentUserName;
        private global::System.Int32 _width;
        private global::System.String _title;

        [Key()]
        [DataMemberAttribute()]
        public global::System.Int32 CommentId
        {
            get { return _commentId; }
            set { _commentId = value; }
        }

        [DataMemberAttribute()]
        public global::System.DateTime CommentDate
        {
            get { return _commentDate; }
            set { _commentDate = value; }
        }

        [DataMemberAttribute()]
        public global::System.Int32 Height
        {
            get { return _height; }
            set { _height = value; }
        }

        [DataMemberAttribute()]
        public global::System.Int32 Width
        {
            get { return _width; }
            set { _width = value; }
        }

        [DataMemberAttribute()]
        public global::System.String CommentUserName
        {
            get { return _commentUserName; }
            set { _commentUserName = value; }
        }

        [DataMemberAttribute()]
        public global::System.String Title
        {
            get { return _title; }
            set { _title = value; }
        }

        public static CommentObject CopyFrom(Web.DAL.Comments c)
        {
            CommentObject copy = new CommentObject();
            copy.CommentDate = c.CommentDate;
            copy.CommentId = c.CommentId;
            copy.Height = c.Height;
            copy.Width = c.Width;
            copy.Title = c.Title.Trim();
            copy.CommentUserName = String.Empty; // c.aspnet_Users.FriendlyName.Trim();
            return copy;
        }

    }
}